<?php
include ("class.php"); 
include ("db/db_connect.php"); 

$id=$_GET["id"];

	$sql="delete from tab_curso where co_curso=".$id."";
	mysql_query($sql, $db_conn)or die("<script>\n alert('Erro ao Deletar!'); \n window.close();\n</script>\n");


/*
######################	
Inicio - Tabela de Log
######################	
*/
session_start();

$date=getdate();
$data= $date["year"]."-".$date["mon"]."-".$date["mday"]." ".$date["hours"].":".$date["minutes"].":".$date["seconds"];
$usuario=$_SESSION['nomeAdmin'];
$id_usuario=$_SESSION['idAdmin'];
$obs=" SQL: ".str_replace("'","\"",$sql)." ";

	$sql1="insert into tab_log(id_usuario, usuario, date, observacao) values($id_usuario,'$usuario','$data','$obs')";
	mysql_query($sql1, $db_conn);
	unset($sql1);
/*
######################	
FIM - Tabela de Log
######################	
*/			
	unset($sql);


	echo "<script>\n alert('Deletado com sucesso!');\nwindow.opener.location='cursos.php';\nwindow.close();\n</script>\n";

?>